import Vue from 'vue'
import App from './App'

import * as Api from './config/api.js'
import * as Common from './config/common.js'
import * as Db from './config/db.js'

// excel 导出
import JsonExcel from 'vue-json-excel'
Vue.component('downloadExcel', JsonExcel)

Vue.config.productionTip = false

Vue.prototype.$api = Api
Vue.prototype.$common = Common
Vue.prototype.$db = Db


Vue.mixin({
	mounted() {
		this.navTitle()
	},
	methods: {
		navTitle() {
			this.$nextTick(() => {
				if(Common.is_weixin()){
				    //隐藏导航栏
					let navTitleDom = document.getElementsByTagName('uni-page-head');
					if (navTitleDom.length) {
						navTitleDom[0].style.display = 'none'
					}
				}
			})
		}
	}
})



App.mpType = 'app'

import uView from 'uview-ui';
Vue.use(uView);

const app = new Vue({
    ...App
})


// http拦截器，此为需要加入的内容，如果不是写在common目录，请自行修改引入路径
import httpInterceptor from '@/common/http.interceptor.js'
// 这里需要写在最后，是为了等Vue创建对象完成，引入"app"对象(也即页面的"this"实例)
Vue.use(httpInterceptor, app)


//挂载实例
app.$mount()
